<?php
/**
 * Created by PhpStorm.
 * User: yy
 * Date: 2019/7/9
 * Time: 14:32
 */

namespace app\api\controller;

use app\common\service\sourceAnalysis\SourceAnalysisService;

/**
 * 源解析
 * Class sourceAnalysis
 * @package app\api\controller
 */
class SourceAnalysis extends BaseController
{
    /**
     * 贡献度占比
     * @author yy by 2019/7/9
     */
    public function getContributionRatebbbbbbb()
    {
        $param = $this->request->param();
        # 模拟数据
        $param = ['start_time' => '2019-07-01', 'end_time' => '2019-07-08', 'region_id' => 53, 'station_id' => 0, 'pollutant_name' => 'so2'];
        $list = [];
        try {
            $sourceAnalysisService = new SourceAnalysisService();
            $list                  = $sourceAnalysisService->getContributionRate($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }
}